package util;

import java.io.BufferedReader;
import java.io.FileReader;




public class FileManager {



	public Crossing[] getCrossings(){
		
		
		Crossing[] ret=null;
		try {
			FileReader in = new FileReader("C:\\crossings.txt");
			
			BufferedReader bufRead = new BufferedReader(in);
			
			String line;
			int count=0;

			line = bufRead.readLine();
			count = new Integer(line);
			ret = new Crossing[count];
			int i = 0;
			line=bufRead.readLine();
			while(line!=null){
				String[] splitLine = line.split("#");
				//System.out.println(count+": "+splitLine[1]+", "+ splitLine[2]);
				ret[i] = new Crossing(splitLine[0],new Double(splitLine[1]),new Double(splitLine[2]));
				line = bufRead.readLine();
				i++;
			}
			bufRead.close();

		} catch (Exception e) {
			
			e.printStackTrace();
		}
		
		return ret;
		
	}
}
